package com.itheima.customer;


import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.UnsupportedEncodingException;

@Component
public class Customer_rabbit {
    @RabbitListener(queues = {ConsumerConfig.QUEUE_SMS})
    public void getSMS(String ss,Message message) throws UnsupportedEncodingException {
        byte[] body = message.getBody();
        String s=new String(body,"utf-8");
        System.out.println(s+"啦啦啦");
        System.out.println(ss);
    }
    @RabbitListener(queues = {ConsumerConfig.QUEUE_EMAIL})
    public void getEamil(String ss,Message message) throws UnsupportedEncodingException {
        byte[] body = message.getBody();
        String s=new String(body,"utf-8");
        System.out.println(s+"接受邮箱信息");
        System.out.println(ss);
    }

}
